<template>
  <el-container>
    <el-aside width="200px">
      <el-menu
        default-active="1"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
        unique-opened="true"
        router="true"
      >
      <img class="logo" src="@/assets/logo.png">
      <el-menu-item index="/">
        <el-icon><Odometer /></el-icon>
        <span>仪表盘</span>
      </el-menu-item>
        <el-sub-menu index="2">
          <template #title>
            <el-icon><Menu /></el-icon>
            <span>常用设置</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/teacher">教师管理</el-menu-item>
            <el-menu-item index="/student">学生管理</el-menu-item>
            <el-menu-item index="/announcement">公告管理</el-menu-item>
            <el-menu-item index="/system">系统配置</el-menu-item>
            <el-menu-item index="/determine">判断服务器</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="3">
          <template #title>
            <el-icon><Aim /></el-icon>
            <span>问题</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/problem">问题列表</el-menu-item>
            <el-menu-item index="/increase">增加题目</el-menu-item>
            <el-menu-item index="/guide">导入导出题目</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="4">
          <template #title>
            <el-icon><Trophy/></el-icon>
            <span>比赛&练习</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/list">比赛列表</el-menu-item>
            <el-menu-item index="/establish1">创建比赛</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
        <el-sub-menu index="5">
          <template #title>
            <el-icon><Collection /></el-icon>
            <span>课程</span>
          </template>
          <el-menu-item-group>
            <el-menu-item index="/curriculum">课程列表</el-menu-item>
            <el-menu-item index="/establish2">创建列表</el-menu-item>
          </el-menu-item-group>
        </el-sub-menu>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>
        <el-icon><Search /></el-icon>
        <el-icon><Share /></el-icon>
        <el-dropdown>
          <span class="el-dropdown-link">
            username
            <el-icon class="el-icon--right">
              <arrow-down />
            </el-icon>
          </span>
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item>logout</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
      <el-footer>BuildVersion20220414</el-footer>
    </el-container>
  </el-container>
</template>

<script>
import{Odometer,Menu,Aim,Trophy,Collection,Search,Share,ArrowDown} from "@element-plus/icons-vue"
export default {
  name: 'App',
  components:{
  Odometer,
  Menu,
  Aim,
  Trophy,
  Collection,
  Search,
  Share,
  ArrowDown
   
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
.logo{
  widows: 100px;
  margin: 40px 0;
}
.el-header{
  background-color: #F9FAFC;
  text-align:right;
  font-weight: bold;
  --el-header-height:50px
  link-height: 50px;
}
.el-dropdown{
  line-height: 10px;
}
.iconclass{
  margin:0 5px;
}
.el-main,.el-footer{
  background-color: #EDECEC;
}
</style>